<div id="adviceTable_head">
<table class="table-responsive table table-hover table-border">
	<thead>
		<tr>
		<td style="width:30px;"><input type="checkbox" value=" "></td>
			<td style="width:70px;">状态</td>
			<td style="width:180px;">开始时间</td>
			<td style="width:400px;">医嘱内容</td>
			<td style="width:50px;">皮试</td>
			<td style="width:150px;">用法</td>
			<td style="width:50px;">总量</td>
			<td style="width:100px;">单位</td>
			<td style="width:100px;">医生嘱托</td>
			<td style="width:100px;">执行科室</td>
			<td style="width:100px;">附加执行</td>
			<td style="width:100px;">执行性质</td>
			<td style="width:100px;">计价性质</td>
			<td style="width:100px;">用药目的</td>
			<td style="width:100px;">医嘱备注</td>
			<td style="width:100px;">开嘱医生</td>
		</tr>
	</thead>
</table>
</div>
<div id="adviceTable_body">
<table class="table-responsive table table-hover table-border">
	{{# 
		var listAll = d.list; 
		var cbm01List = d.rows;
	 }}
	{{# for(var j = 0; j< cbm01List.length;  j++){ 
		var bda01 = cbm01List[j]['bda01'];
		var result = "治疗";
		switch (bda01) {
			case "1": result = "西成药"; break;
			case "2": result = "西成药"; break;
			case "8": result = "中草药"; break;
			case "E": result = "检查"; break;
			case "L": result = "检验"; break;
			case "S": result = "手术"; break;
		}
	}}
	<tbody>
		<tr class="innerHead" data-cbm01List = '{{cbm01List[j]['cbm01']}}'>
		 	<td style="width:30px;"><input type="checkbox" value=" " ></td>
			<td class="text-left" colspan="16">
			    <!-- <input type="checkbox" checked="checked" value=" " style="margin-left:5px;"> -->
				<button class="btn btn-transparent">
					<lable class="glyphicon glyphicon-chevron-down"></lable> <span>{{result}}</span>
				</button>
			</td>
		</tr>
		{{# 
			var list1 = []; 
			for(var k = 0; k< listAll.length;  k++)
			{
			    if(cbm01List[j]['cbm01'] == listAll[k]["cbm01"])
			    { 
			    	list1.push(listAll[k]);
			    } 
			 }
		 }}
		  {{# var list = list1.sort(function(a,b){return ((parseInt(a.vaf59))-(parseInt(b.vaf59)))}); }}<!-- 数组排序 -->
		  {{# for(var i = 0;i<list.length;i++){ }}
		<tr class="yizhu_details"  data-info='{{JSON.stringify(list[i])}}'>
			<td ></td>
		    <td style="display:none">bda01{{ list[i]['bda01'] }}</td>
			{{# if(list[i]['vaf25']== '+'){ }}
			{{# if(list[i]['fstatus']== '新开'){ }}
			<td style="width:70px;background-color:#2fbd83;color:#fff">{{ list[i]['fstatus']?list[i]['fstatus']:'' }}</td><!-- 状态 -->
			{{# }else if(list[i]['fstatus']== '已发送'){ }}
			<td style="width:70px;background-color:#ff6f6f;color:#fff">{{ list[i]['fstatus']?list[i]['fstatus']:'' }}</td><!-- 状态 -->
			{{# }else{ }}
			<td style="width:70px; background-color:#ccc">{{ list[i]['fstatus']?list[i]['fstatus']:'' }}</td><!-- 状态 -->
			{{# } }}
			<td style="color:red;width:180px;">{{ list[i]['vaf36']?list[i]['vaf36']:'' }}</td><!-- 医嘱开始时间 -->
			<td style="color:red;width:400px;">{{ list[i]['vaf22']?list[i]['vaf22']:'' }}</td><!-- 医嘱内容 -->
			<td style="color:red;width:50px;">{{ list[i]['vaf25']?list[i]['vaf25']:'' }}</td><!-- 是否皮试 -->
			<td style="color:red;width:150px">{{ list[i]['fusage']?list[i]['fusage']:'' }}</td><!-- 用法 -->
			<td style="color:red;width:50px;">{{ list[i]['vaf21']?list[i]['vaf21']:'' }}</td><!-- 总量 -->
			<td style="color:red;width:100px;">{{ list[i]['fgross']?list[i]['fgross']:'' }}</td><!-- 单位 -->
			<td style="color:red;width:100px;">皮试（+）</td><!-- 医生嘱托 -->
			<td style="color:red;width:100px;">{{ list[i]['nbck03']?list[i]['nbck03']:'' }}</td><!-- 执行科室 -->
			<td style="color:red;width:100px;">{{ list[i]['bck03f']?list[i]['bck03f']:'' }}</td><!-- 附加执行 -->
			<td style="color:red;width:100px;">{{ list[i]['vaf58']?list[i]['vaf58']:'' }}</td><!-- 执行性质 -->
			<td style="color:red;width:100px;">{{ list[i]['vaf31']?list[i]['vaf31']:'' }}</td><!-- 计价性质 -->
			<td style="color:red;width:100px;">{{ list[i]['biw02']?list[i]['biw02']:'' }}</td><!-- 用药目的 -->
			<td style="color:red;width:100px;">{{ list[i]['vaf55']?list[i]['vaf55']:'' }}</td><!-- 医嘱备注 -->
			<td style="color:red;width:100px;">{{ list[i]['bce03g']?list[i]['bce03a']:'' }}</td><!-- 开嘱医生 -->
			{{# }else{ }}
			{{# if(list[i]['fstatus']== '新开'){ }}
			<td style="width:70px;background-color:#2fbd83;color:#fff">{{ list[i]['fstatus']?list[i]['fstatus']:'' }}</td><!-- 状态 -->
			{{# }else if(list[i]['fstatus']== '已发送'){ }}
			<td style="width:70px;background-color:#ff6f6f;color:#fff">{{ list[i]['fstatus']?list[i]['fstatus']:'' }}</td><!-- 状态 -->
			{{# }else{ }}
			<td style="width:70px; background-color:#ccc">{{ list[i]['fstatus']?list[i]['fstatus']:'' }}</td><!-- 状态 -->
			{{# } }}
			<td style="width:180px;">{{ list[i]['vaf36']?list[i]['vaf36']:'' }}</td><!-- 医嘱开始时间 -->
			<td style="width:400px;">{{ list[i]['vaf22']?list[i]['vaf22']:'' }}</td><!-- 医嘱内容 -->
			<td style="width:50px;">{{ list[i]['vaf25']?list[i]['vaf25']:'' }}</td><!-- 是否皮试 -->
			<td style="width:150px;">{{ list[i]['fusage']?list[i]['fusage']:'' }}</td><!-- 用法 -->
			<td style="width:50px;">{{ list[i]['vaf21']?list[i]['vaf21']:'' }}</td><!-- 总量 -->
			<td style="width:100px;">{{ list[i]['fgross']?list[i]['fgross']:'' }}</td><!-- 单位 -->
			<td style="width:100px;">{{ list[i]['vaf23']?list[i]['vaf23']:'' }}</td><!-- 医生嘱托 -->
			<td style="width:100px;">{{ list[i]['nbck03']?list[i]['nbck03']:'' }}</td><!-- 执行科室 -->
			<td style="width:100px;">{{ list[i]['bck03f']?list[i]['bck03f']:'' }}</td><!-- 附加执行 -->
			<td style="width:100px;">{{ list[i]['vaf58']?list[i]['vaf58']:'' }}</td><!-- 执行性质 -->
			<td style="width:100px;">{{ list[i]['vaf31']?list[i]['vaf31']:'' }}</td><!-- 计价性质 -->
			<td style="width:100px;">{{ list[i]['biw02']?list[i]['biw02']:'' }}</td><!-- 用药目的 -->
			<td style="width:100px;">{{ list[i]['vaf55']?list[i]['vaf55']:'' }}</td><!-- 医嘱备注 -->
			<td style="width:100px;">{{ list[i]['bce03g']?list[i]['bce03a']:'' }}</td><!-- 开嘱医生 -->
			{{# } }}
		</tr>
		{{# } }}
	</tbody>
	{{# } }}
</table>
</div>

